Skip to content

release(unified): DAG failure observability + /goal restoration + config-repo templates - #173

Merged
LeXwDeX merged 18 commits into
mainfrom
dev
Aug 4, 2026
Merged

release(unified): DAG failure observability + /goal restoration + config-repo templates#173
LeXwDeX merged 18 commits into
mainfrom
dev

Conversation

@LeXwDeX

@LeXwDeX LeXwDeX commented Aug 4, 2026

Copy link
Copy Markdown
Owner

dev → main 正式版门禁。

包含 #172 全部内容(三束统一版本):

  • 束 A:DAG 节点失败可观测性(error_class 持久化 + 全决策面暴露 + triage 指引)
  • 束 B:/goal 自主目标模块恢复(状态管理 + 工具注册 + judge 循环 + HTTP/TUI 面)
  • 束 C:config-repo 模板体系(builtin 三级作用域 + /dag-template-update + cygpath 修复)

dev CI 全绿(Typecheck + 全量测试),release 预发布二进制已在 macOS/Linux/Windows 冒烟通过 + 7 项边界测试无 bug。

评审链:三轮深度评审(round 1-3)+ 终审确认(9/9 门禁)+ 收尾审计 PASS + 双轴 Standards/Spec review + README 对齐 + lint ratchet。

LeXwDeX and others added 18 commits August 3, 2026 11:37
chore(docs): untrack project-local design notes
fix(docs): restore harness-dag.md tracking, ignore only personal notes
dev/main 不再维护 DAG 参考模板(权威源为 opencode-dag-config 仓库)。
每次 release 时 package-templates job clone 配置仓库并打包
dag-templates.tar.gz 作为 release 资产附带;只读操作,不写主仓库。
dag-flow.txt 改为指引 workflow library 两级 scope(全局优先、项目覆盖)。
日常更新全局参考模板走 zip 下载(无需 git/SSH):
预演分类(NEW/UNCHANGED/UPDATE)→ 无冲突直接合并,
覆盖同名文件前备份并 QA 决策。与 release 完全解耦。
- workflows.ts: add builtin scope (compiled-in templates) as third
  resolution tier after project/global; list/resolve cover it
- generate.ts/build.ts: inject OPENCODE_DAG_TEMPLATES from
  DAG_TEMPLATES_DIR so release binaries ship curated templates for
  air-gapped installs
- workflow.ts: read builtin specs from the injected map (no backing file)
- release-fork.yml: build-cli downloads the packaged templates artifact
  and feeds DAG_TEMPLATES_DIR; package-templates guards empty glob
- dag-template-update.txt: concurrency lock, backup-failure abort,
  content-based verification
- remove tracked .opencode/workflows templates (config repo is the sole
  source; builtin + global scopes cover runtime)
- guard OPENCODE_DAG_TEMPLATES with typeof check so bare source/test runs
  don't throw ReferenceError (mirrors OPENCODE_MODELS_DEV); add fallback
  parse tolerance for malformed builtin specs
- dedupe Entry interface, extract builtinEntry/builtinName, share parseMeta
- list/resolve not-found hints include builtin scope when present
- drop stale change-review test (repo no longer ships templates)
- release-fork: skip cp on empty template glob; drop redundant
  dag-templates artifact re-download in release job
Project-scope workflow library (.opencode/workflows): review-oriented
one-off topologies derived from the deep-review-dag-module reference
(perf, complexity, subsystem reviews).

Deep-review session artifacts (.opencode/.dag-specs): one-off specs and
persisted reviewer/verifier outputs for the PR#167 and joint-diff review
rounds (admission briefs, manifests, gate results, final audit report) —
kept as the evidence trail for the remediation decisions.
The Extract Templates step wrote the Git Bash path form of
$GITHUB_WORKSPACE/dag-templates-src into GITHUB_ENV without the
`cygpath -m` conversion that the models.dev step in the same job applies,
so the native bun consumer in script/generate.ts would receive an
unresolvable path on windows-latest. Mirror the models.dev pattern.

Also make generate.ts fail loudly with a contextual error when
DAG_TEMPLATES_DIR is set but missing (points at the offending value and
the likely cause), instead of a bare glob/IO error.

Confirmed by the final-confirmation review arbiter (sole HIGH; all other
findings explicitly deferred).
Persist the dag.node.failed trigger as workflow_node.error_class and
expose it on every agent-visible surface: status output, wake node-line
suffix and failed-workflow attribution digest, httpapi NodeResponse, SDK.

Failure-triage guidance for the parent agent: per-class response table
(timeout/exec_failed/verdict_fail), cascade detection shapes (skipped
terminalization with paused nuance; Dependency-interpolation shape),
orchestrator_unresponsive zero-attribution recipe, continuation-workflow
recovery for terminal failures. Budget declaration calls out that
verifier/aggregator lanes need 20-30 minutes, not the fan-out default.

Tests: projector persistence, status output, wake digest attribution,
cancelled-node null invariant, recovery classes, paused required-failure
terminalization, httpapi error_class on-the-wire fixture.
…tool registration

Restore the /goal feature faithfully from the pre-retirement baseline
(826bf59), adapted to the current architecture:

- Goal state service: goal_state table, load/set/pause/resume/clear/
  markDone/subgoals, goal.updated/goal.cleared events
- GoalLoop: idle-driven continuation with judge, kick dispatch, turn
  budget/pause semantics, crash-safe fiber lifecycle
- /goal + /subgoal slash dispatch in session prompt (early return before
  command registry), goal tool (status/complete) in the tool registry
- System prompt injection: static mechanism + live goal-state block,
  wired on BOTH composition systems (Goal.defaultLayer + Goal.node in
  SystemPrompt deps)
- HTTP API session.goal (404 when goalless, contract-honest null-free
  200), SDK Goal types + client method, TUI sidebar widget + sync
  reducer/hydration, httpapi-exercise goal + goal-less scenarios
- Session cleanup on remove; GOAL/SUBGOAL command entries

Tests: restored goal suites, new session-level dispatch tests
(set+kick, status, subgoal, Goal-absent fallthrough), TUI sync-goal
reducer tests. All gates green: 471 opencode tests, 227 httpapi
scenarios, typecheck across packages.
…biter verdicts

Evidence trail for the closing audit rounds: final-confirmation specs
(monolithic + split continuation), persisted lane outputs (config-repo
review, stack integrity, 9/9 gates), and the arbiter LOOP verdict that
drove the cygpath HIGH fix.
- dag-flow.txt: reference templates resolve by NAME through three scopes
  (project > global > builtin) instead of hardcoded project paths; the four
  curated topologies may be absent in bare dev checkouts — explicit
  compose-fresh fallback
- bootstrap.ts: clarify GoalLoop bootstrap wiring (BootstrapLayer inclusion
  is serviceOption availability only; no bootstrap caller inits it; memoMap
  dedups) — resolves the comment-vs-wiring contradiction
- prompt.ts: dedupe goal/subgoal dispatch user-message construction shared
  by the error and success branches
- goal/{loop,judge,prompts}.ts: drop opaque internal task-id markers (D5,
  D4.x) from comments, keep the semantic content
…wiring

The comment claimed optionality as if Goal were generally absent; make the
two-tier reality explicit — SystemPrompt.layer stays buildable without Goal
(bare test harnesses, degraded note) while production compositions always
provide it (defaultLayer + LayerNode deps), so the goal block renders.
…re triage, three-tier library)

- Drop the obsolete 'goal auto-loop is gone' statement; document the
  restored /goal + /subgoal feature in a dedicated section (commands,
  judge loop + turn budget, goal tool self-complete, system-prompt live
  block, TUI widget, GET /session/:id/goal 404 contract, durability)
- Reference topologies now ship via the global scope (opencode-dag-config)
  and a builtin tier in release binaries; workflow library table gains the
  builtin row, resolution order, and /dag-template-update sync description
- Document node failure triage: failure classes surfaced on status/wake
  with attribution digest, driving targeted repair instead of restart
- Remove the stale change-review.yaml doc link (file no longer tracked);
  keep the built-in skill wording scope-accurate
Clear 28 mechanical warnings introduced by the /goal restoration (redundant
Number() conversions on already-number-typed GoalState fields, unnecessary
status literal cast, unnecessary type-argument defaults, unused test
imports, unknown-in-template-literal). Remaining 23 net-new (no-misused-
spread on intentional plain-object conversion + no-unsafe-type-assertion in
test mocks) match existing repo-wide idioms counted in the ratchet; the
ceiling moves 4711 -> 4734 accordingly.
…fig-repo templates (#172)

Unified release: three bundles (error_class failure observability + triage guidance, /goal module restoration with state management and tool registration, config-repo template system with Windows cygpath fix) consolidated from the closed #169/#170/#171. Reviewed through three deep-review rounds + final-confirmation audit + closeout PASS + two-axis Standards/Spec review + README alignment + lint ratchet.
@LeXwDeX
LeXwDeX merged commit d1c2c45 into main Aug 4, 2026
24 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant